package org.xx.armory.swing.builders;

import org.xx.armory.objectparser.ParsedObjectBuilder;

public class ColumnModelBuilder
        extends ParsedObjectBuilder<ColumnModel> {
    private int stretch;
    private ModelAlignment alignment;

    public ColumnModelBuilder() {
        this.alignment = ModelAlignment.BOTH;
    }

    public final ColumnModelBuilder setStretch(
            int stretch
    ) {
        this.stretch = stretch;
        return this;
    }

    public final ColumnModelBuilder setAlignment(
            ModelAlignment alignment
    ) {
        this.alignment = alignment;
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public ColumnModel build() {
        return new ColumnModel(getLineInfo(), this.stretch, this.alignment);
    }
}
